class GithubOauth2Plugins {


    constructor({
                    clientID="8330092503c45343236e",
                    clientSecrets="e936b49f2809b40135e85ef479e35a9ffcf1d56e"
                }) {
        this.clientID=clientID;
        this.clientSecrets=clientSecrets;
    }


    install(app,args){

        app.get(`/github/githubcallback`,async (req,res)=>{
                const {code}=req.params;
                // let access_token_res= await  M.request.post("https://github.com/login/oauth/access_token",{
                //     "client_id":this.clientID,
                //     "client_secret":this.clientSecrets,
                //     "code":code
                // })
              // console.log(code,access_token_res)

            console.log("req ", req.url)
            let dataSource= {
                name:"zs",
                hobby:["烫头","洗脚"]
            }
            //渲染静态目录本地文件
            res.render("index.html");
            //res.render("/index.html");
            //渲染本地文件
            //res.render("file:D:/G/ming_node/test/test.html");
            //渲染百度首页
            // res.render("https://www.baidu.com/index.html");
         })

    }

}

module.exports = GithubOauth2Plugins;